package cn.xxstudy.visitshop.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import cn.xxstudy.visitshop.R
import cn.xxstudy.visitshop.base.adapter.BaseAdapter
import cn.xxstudy.visitshop.ui.activity.main.fragment.visit.model.VisitData
import cn.xxstudy.visitshop.ui.activity.task.model.TaskData
import kotlinx.android.synthetic.main.item_visit.view.*

/**
 * @author ：DELL on 2021/3/25 .
 * @packages ：cn.xxstudy.visitshop.adapter .
 * TODO:一句话描述
 */
class VisitAdapter : BaseAdapter<VisitData, VisitAdapter.VisitViewHolder>() {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VisitViewHolder {
        val rootView =
            LayoutInflater.from(parent.context).inflate(R.layout.item_visit, parent, false)
        return VisitViewHolder(rootView)
    }

    override fun onBindViewHolder(holder: VisitViewHolder, position: Int) {
        super.onBindViewHolder(holder, position)
        holder.itemView.visitDate.text = "巡店日期：${datas[position].visitDate}"
        holder.itemView.shopName.text = "店面名称：${datas[position].shopName}"
    }

    inner class VisitViewHolder(rootView: View) : RecyclerView.ViewHolder(rootView)
}